package com.dmy.component;

import com.dmy.config.GlobleConfig;

import java.awt.*;
import java.util.Random;

public class SimpleFood extends Food {


    public SimpleFood(MJPanel mjPanel) {
        super(mjPanel);
    }

    @Override
    public void paint(Graphics2D g) {
        g.setColor(this.getColor());
        g.fillRect(getX(),getY(), GlobleConfig.S_SIZE,GlobleConfig.S_SIZE);
        g.setColor(Color.white);
        g.setFont(new Font("宋体",Font.BOLD,10));
        g.drawString(String.valueOf((int)(this.getTimeout()-System.currentTimeMillis())/1000),this.getX()+(GlobleConfig.S_SIZE/2)-2,this.getY()+(GlobleConfig.S_SIZE/2)+2);
    }
}
